package com.oig.sys.auth.dto;

import com.oig.common.validator.EnumValue;
import com.oig.common.validator.GroupAdd;
import com.oig.common.validator.GroupEdit;
import com.oig.sys.auth.constants.AuthEnums;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
@Schema(description = "子应用参数")
public class SystemDto {


    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "参数错误,id不能为空", groups= GroupEdit.class)
    private Integer id;
    @Schema(description = "编码", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误，编码不能为空", groups={GroupAdd.class, GroupEdit.class})
    private String systemCode;
    @Schema(description = "系统名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误，系统名称不能为空", groups={GroupAdd.class, GroupEdit.class})
    private String systemName;
    @Schema(description = "图标id")
    private String imageId;
    @Schema(description = "图标地址")
    private String imageUrl;
    @Schema(description = "显示顺序")
    private Integer sort;
    @Schema(description = "应用类型 0-内部应用 1-手机app 2-外部应用")
    @EnumValue(message = "应用类型值不正确", enumClass=AuthEnums.SystemTypeEnum.class, enumValidMethod="validCode", groups={GroupAdd.class, GroupEdit.class})
    private String systemType;
    @Schema(description = "外部应用url")
    private String systemUrl;

}
